package superheros.mae.app;

import mae.app.CollectionsDatabaseHelper;
import mae.app.SuperheroAdapter;
import android.app.ListActivity;
import android.database.Cursor;
import android.os.Bundle;
import android.widget.SimpleCursorAdapter;



public class SuperheroPiece extends ListActivity {
	private SuperheroAdapter adap;
	private CollectionsDatabaseHelper cbh;

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);


		
		String[] from = new String[]{adap.KEY_NAME, adap.KEY_YEAR,
				adap.KEY_VALUE, adap.KEY_STATUS};
		
		int[] to = new int[] {android.R.id.text1};
		adap = new SuperheroAdapter(this);
		adap.open();
		
		
		Cursor c = adap.fetchAllSuperhero();
		
		SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
				android.R.layout.simple_list_item_1, c, from, to);
		setListAdapter(adapter);
		
	}
}